package com.yifeng.repo.micro.service.server.mps;

import feign.Param;
import feign.RequestLine;
import next.fire.mps.api.MessageService;
import next.fire.mps.api.model.DateRange;
import next.fire.mps.api.model.MsgResultItem;
import next.fire.mps.api.model.MsgSceneEnum;
import next.fire.mps.api.model.MsgTaskItem;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;
import java.util.Map;

@FeignClient(name = "mpsMessageServiceClient", url = "${yfcloud.micro.service.mps.url}", path = "/fire-mps")
public interface MessageServiceClient extends MessageService {

    @Override
    @RequestLine("POST /MessageService/send")
    String send(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("msgScene") MsgSceneEnum msgScene, @Param("msgData") Map msgData);

    @Override
    @RequestLine("POST /MessageService/send")
    String send(@Param("appId") String appId, @Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("msgScene") MsgSceneEnum msgScene,
                @Param("msgData") Map msgData);

    @Override
    @RequestLine("POST /MessageService/listSend")
    List<String> listSend(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("single") boolean single,
                          @Param("pageSize") int pageSize, @Param("dateRange") DateRange dateRange);

    @Override
    @RequestLine("POST /MessageService/stopSend")
    boolean stopSend(@Param("appId")String appId, @Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("msgId") String msgId);

    @Override
    @RequestLine("POST /MessageService/listSendMsgTaskByDeprecated")
    List<MsgTaskItem> listSendMsgTask(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId,
                                      @Param("msgId") String msgId, @Param("pageSize") int pageSize);

    @Override
    @RequestLine("POST /MessageService/listSendMsgTask")
    List<MsgTaskItem> listSendMsgTask(@Param("appId") String appId, @Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId,
                                      @Param("msgId") String msgId, @Param("offset") String offset, @Param("pageSize") int pageSize);

    @Override
    @RequestLine("POST /MessageService/listMsgResultByDeprecated")
    List<MsgResultItem> listMsgResult(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId,
                                      @Param("msgId") String msgId, @Param("userid") String userid,
                                      @Param("pageSize") int pageSize);

    @Override
    @RequestLine("POST /MessageService/listMsgResult")
    List<MsgResultItem> listMsgResult(@Param("appId") String appId, @Param("merchantId") String merchantId,
                                      @Param("mpAppId") String mpAppId, @Param("msgId") String msgId,
                                      @Param("userId") String userId, @Param("offset") String offset,
                                      @Param("pageSize") int pageSize);

}
